﻿using System.ComponentModel.DataAnnotations;
using WebMvc.Models;

namespace WebMvc.Areas.Sys.Models
{
    /// <summary>
    /// 对象名称：功能菜单的数据实体类（数据实体层）    
    /// 作者姓名：yb   
    public class Menu : BaseT
    {
        [Required(ErrorMessage = "父级ID不能为空。")]
        [Display(Name = "父级ID")]
        public int ParentId { get; set; }

        [Required(ErrorMessage = "菜单名称不能为空。")]
        [Display(Name = "菜单名称")]
        public string Name { get; set; }

        [Required(ErrorMessage = "菜单编码不能为空。")]
        [Display(Name = "菜单编码")]
        public string Code { get; set; }

        [Required(ErrorMessage = "菜单地址不能为空。")]
        [Display(Name = "菜单地址")]
        public string Url { get; set; }
        
        [Display(Name = "菜单类型")]    // 类型：0导航菜单；1操作按钮
        public int Type { get; set; }
        
        [Display(Name = "菜单图标")]
        public string Icon { get; set; }

        public override string ToString() => Name;
        

    }
}
